<?php


namespace app\common\service\order\coupon_order\fake_order;


use app\common\service\order\coupon_order\Base;
use app\common\service\order\coupon_order\CouponOrderChannelInterface;
use app\model\BaseSupplier;
use app\model\CouponOrder;
use Carbon\Carbon;

abstract class FakeOrderBase extends Base implements CouponOrderChannelInterface
{


    /**
     * 同步订单
     * @return mixed
     */
    abstract public function syncOrder();


    /**
     * 类型 常量类型
     * @return mixed
     */
    abstract public function getServType();

    /**
     * 产品名称 可以是title
     * @return mixed
     */
    abstract public function getProductName();

    /**
     *  获取结算状态
     * @return mixed
     */
    abstract public function getAgentSettleStatus();

    /**
     * 获取状态
     * @return mixed
     */
    abstract public function getStatus();

    /**
     * 退款金额
     */
    public function getRefundAmount()
    {
        return 0;
    }


    /**
     * 获取渠道标识
     */
    public function getSid()
    {
        return 'test';
    }

    public function getSupplierId()
    {

       $baseSupplier = BaseSupplier::orderByDesc()->find();

       return $baseSupplier->id;
    }

    public function getSupplierOrderSn()
    {
        return time().rand(1,99999).rand(1,99999);
    }

    /**
     * 获取第三方订单号
     */
    public function getOutOrderId()
    {
        return $this->getSupplierOrderSn();
    }

    public function getOrderId()
    {
        return time().rand(1,99999).rand(1,99999);
    }

    public function getAmount()
    {
        return yuan2fen(2);
    }

    public function getOrderAllCommission()
    {
        return 1;
    }

    public function getAgentSettleDiscount()
    {
        return 50;
    }

    public function getAgentId()
    {
        return $this->agent_id;
    }

    public function getOriginAmount()
    {
        return 11;
    }

    public function getPayAmount()
    {
        return yuan2fen(2);
    }

    public function getPayStatus()
    {
        return CouponOrder::C_PAY_STATUS_YES;
    }

    public function getPayTime()
    {
        return Carbon::now()->format('Y-m-d H:i:s');
    }

    public function getUserId()
    {
        return $this->user_id;
    }

    public function getStatusDesc()
    {
       return '测试数据';
    }

    public function getSettledAt()
    {
        return Carbon::now()->subDays(5)->format('Y-m-d H:i:s');
    }

    public function getType()
    {
        return $this->serv_type;
    }

    public function getCnid()
    {
         return 1;
    }

    public function getSettleType()
    {
        return SETTLE_TYPE_PROFIT;
    }

    public function getSupplierCode()
    {
        return 'test';
    }


    public function getExtData()
    {
       return $this->params;
    }

    public function getOrderCreatedAt()
    {
        return Carbon::now()->format('Y-m-d H:i:s');
    }

    public function getTitle()
    {
        return '我是测试数据';
    }

    public function getRefundStatus()
    {
        return CouponOrder::C_REFUND_STATUS_NO;
    }


}